package com.quick.admin.controller;

import com.quick.admin.service.AdminProductService;
import com.quick.common.dto.DtsGoodsDto;
import com.quick.common.dto.PageDto;
import com.quick.common.result.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：chicunxiang
 * @date ：Created in 2021/2/1 09:08
 * @description：
 * @version: 1.0
 */
@RestController
public class AdminProductController {

    @Autowired
    private AdminProductService mAdminProductService;

    @GetMapping(value = "search")
    public ResultEntity<PageDto<List<DtsGoodsDto>>> search(@RequestParam(value = "content", required = false) String content,
                                                           @RequestParam(value = "page") int page,
                                                           @RequestParam(value = "pageSize") int pageSize) {

        return ResultEntity.ok(mAdminProductService.getGoods(content, page, pageSize));
    }


}
